package cm.match;

import cm.match.dto.RuleDto;
import cm.match.rule.impl.*;

import java.util.Arrays;
import java.util.Collections;

public class RuleServices {
    
    /**
     * 学生规则教研
     *
     * @return
     */
    public static RuleService isValidStudent(RuleDto ruleDto) {
        AgeRule ageRule = new AgeRule();
        NameRule nameRule = new NameRule();
        NationalityRule nationalityRule = new NationalityRule();
        AddressRule addressRule = new AddressRule();
        SubjectRule subjectRule = new SubjectRule();
        Flag110Rule flag110Rule = new Flag110Rule();

        return RuleService
                .create(ruleDto)
                .and(Arrays.asList(nationalityRule, nameRule, addressRule))
                .or(Arrays.asList(ageRule, subjectRule))
                .not(Collections.singletonList(flag110Rule));
    }
}
